import request from '@/config/axios'

export interface CraftCuttingWeightVO {
  id: number
  dictMaterialCategory: number
  materialNumber: string
  material: string
  specification: string
  dictUnit: number
  density: number
  meterWeight: number
  dictEnableStatus: number
  remark: string
}

// 查询配置中心--工艺配置--下料重量列表
export const getCraftCuttingWeightPage = async (params) => {
  return await request.get({ url: `/config/craft-cutting-weight/page`, params })
}

// 查询配置中心--工艺配置--下料重量详情
export const getCraftCuttingWeight = async (id: number) => {
  return await request.get({ url: `/config/craft-cutting-weight/get?id=` + id })
}

// 新增配置中心--工艺配置--下料重量
export const createCraftCuttingWeight = async (data: CraftCuttingWeightVO) => {
  return await request.post({ url: `/config/craft-cutting-weight/create`, data })
}

// 修改配置中心--工艺配置--下料重量
export const updateCraftCuttingWeight = async (data: CraftCuttingWeightVO) => {
  return await request.put({ url: `/config/craft-cutting-weight/update`, data })
}

// 删除配置中心--工艺配置--下料重量
export const deleteCraftCuttingWeight = async (id: number) => {
  return await request.delete({ url: `/config/craft-cutting-weight/delete?id=` + id })
}

// 导出配置中心--工艺配置--下料重量 Excel
export const exportCraftCuttingWeight = async (params) => {
  console.log(params)
  return await request.download({ url: `/config/craft-cutting-weight/export-excel`, params })
}

// 下载导入模板
export const importCraftCuttingWeightTemplate = async () => {
  return await request.download({ url: `/config/craft-cutting-weight/get-import-template` })
}
